const state = {
  ct_id: null,
  ct_fun_no: null,
  ifEnd: '已签发',
  handleType: 'view',
}
const mutations = {
  SET_CT_ID: (state, ct_id) => {
    state.ct_id = ct_id
  },
  SET_CT_FUN_NO: (state, ct_fun_no) => {
    state.ct_fun_no = ct_fun_no
  },
  SET_IFEND: (state, ifEnd) => {
    state.ifEnd = ifEnd
  },
  SET_HANDLETYPE: (state, handleType) => {
    state.handleType = handleType
  },
}
const actions = {
  setRecordParams({ commit }, row) {
    commit('SET_CT_ID', row.ct_id)
    commit('SET_CT_FUN_NO', row.ct_fun_no)
    if (row.ifEnd) {
      commit('SET_IFEND', row.ifEnd)
    } else {
      commit('SET_IFEND', '已签发')
    }
    if (row.handleType) {
      commit('SET_HANDLETYPE', row.handleType)
    } else {
      commit('SET_HANDLETYPE', 'view')
    }
  },
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
